#include <pthread.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <pthread.h>
#include <fcntl.h>
#include <semaphore.h>
#include <sys/mman.h>


#define SERVER_ON 1
#define SERVER_OFF 0

#define USERS_FILE "users.txt"

#define SHM_SIZE 1024

//Operations
#define Add_Account 'a'
#define Remove_Account 'r'
#define Withdraw 'w'
#define Deposit 'd'
#define CheckBalance 'c'
#define ListAccounts 'l'
#define Shutdown 's'

/*typedef struct request
{
	int pid;
	char type;
	int AccountNumber;
	char AccountName[21];
	char pin[5];
	float AccountBalance;
	float value; // For transfers
	int TargetAccount; // For transfers
}Request;*/

// Functions
void *AddAccount(void * req);
void *RemoveAccount(void * req);
void *UserWithdraw(void * req);
void *UserDeposit(void * req);
void *CheckUserBalance(void * req);
void *AdminListAccounts(void * req);
void *ShutdownServer(void * req);

